package com.cn.api;


import com.cn.dto.CouponDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Primary
@FeignClient(value = "order-server-core-biz", path = "/api/front")
public interface FrontFeignClient {
    @PostMapping("/advertisement")//前端广告展示
    CouponDTO advertisement(@RequestParam("advertisement") int coupon_id);

    @PostMapping("/findAll")
    List<CouponDTO> findAll(@RequestBody CouponDTO couponDTO);

    @PostMapping("/findByState")
    CouponDTO findByState(@RequestParam("state") int state);

    @PostMapping("/getCoupon")//去领取
    CouponDTO getCoupon(@RequestBody CouponDTO couponDTO);

    @PostMapping("/receive")//领取
    Integer receive(@RequestParam("id") int id);

    @PostMapping("/usedCoupon")
    Integer usedCoupon(@RequestParam("id") int id);
}